﻿
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RendicionListForm.aspx.cs" 
Inherits="UILGestion.ObraAdmin.RendicionCaja.RendicionListForm" %>

<%@ Register Assembly="SesarchResultLib" Namespace="SesarchResultLib" TagPrefix="cc2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register src="~/Control/menuObraCtrl.ascx" tagname="menuObraCtrl" tagprefix="uc1" %>
<%@ Register assembly="CustomControls" namespace="CustomControls" tagprefix="cc1" %>

<%@ Register src="RendicionAddPanel.ascx" tagname="RendicionAddPanel" tagprefix="uc2" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Estructura Costo</title>

    <link href="~/css/main.css" rel="stylesheet" type="text/css" />
    <link href="../../resources/css/main.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/theme.css" />
  
</head>
<script type="text/javascript">
    function switchViews(obj, row) {
//        var div = document.getElementById(obj.id);
//      

//        if (div.style.display == "none") {
//            div.style.display = "inline";
//            if (row == 'alt') {
//                img.src = "../Images/expand_button_down.png";
//                mce_src = "../Images/expand_button_down.png";
//            }
//            else {
//                img.src = "../Images/expand_button.png";
//                mce_src = "../Images/expand_button.png";
//            }
//            img.alt = "Cerrar para ver otros Reendimientos";
//        }
//        else {
//            div.style.display = "none";
//            if (row == 'alt') {
//                img.src = "../Images/expand_button.png";
//                mce_src = "../Images/expand_button.png";
//            }
//            else {
//                img.src = "../Images/expand_button.png";
//                mce_src = "../Images/expand_button.png";
//            }
//            img.alt = "Expand para mostrar Recursos";
 //       }
    }
    </script>
<body   >
    <form id="form1" runat="server">
    
       <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"   EnableScriptGlobalization="true"  
     EnablePartialRendering="true" >


    </asp:ToolkitScriptManager>
    <uc1:menuObraCtrl ID="menuObraCtrl1" runat="server" />

 <asp:Panel ID="Panel1" runat="server"
  CssClass="Heading secTitle AreaHeading ms-crm-List-Header "      >
        <asp:Label ID="Label1" runat="server" Text="LISTA CAJA CHICA" style="font-size: large; color: #960818"> </asp:Label>
</asp:Panel>  


<asp:Panel ID="Panel18" runat="server"   >
        
<table width="900px" >
 <tr  >
               
                <td class=" ms-crm-Dialog-Footer">
               
                   <%--  <asp:Button ID="actualizarbtn" runat="server" Text="Actualizar" 
                         onclick="actualizarbtn_Click" />--%>
               
                    
                   
                </td>
            


   
</table>
        </asp:Panel> 




<asp:Panel ID="pnlMain" runat="server"
     BackColor="White" >

  <asp:UpdatePanel ID="totalesUpdatePanel" runat="server" UpdateMode="Conditional">
  <ContentTemplate>
 
      
      
  <table class="ui-accordion">
          <tr>
              <td width="350px">
                  &nbsp;</td>
              <td>
               <asp:Panel ID="totalesPanel" runat="server" GroupingText="Fondo Asigando Obra"  width="350px" BackColor="White">
                  <table class="PanelTotales">
                      <tr>
                          <td align="right" width="150px">
                              &nbsp;</td>
                          <td align="right" width="100px">
                              <strong>Soles</strong></td>
                          <td align="right">
                              <strong>Dolares</strong></td>
                      </tr>
                      <tr>
                          <td align="right" width="150px">
                              <b>Total Deposito: </b>
                          </td>
                          <td align="right" width="100px">
                              <asp:Label ID="totalDesembolsoLbl" runat="server"></asp:Label>
                          </td>
                          <td align="right" width="100px">
                              <asp:Label ID="totalDesembolsoDOL" runat="server"></asp:Label>
                          </td>
                      </tr>
                      <tr>
                          <td align="right" width="150px">
                              <b>Total Rendicion: </b>
                          </td>
                          <td align="right" width="100px">
                              <asp:Label ID="totalRendicionLbl" runat="server"></asp:Label>
                          </td>
                          <td align="right" width="100px">
                              <asp:Label ID="totalRendicionDOL" runat="server"></asp:Label>
                          </td>
                      </tr>
                      <tr>
                          <td align="right" width="150px">
                              <b>Pendiente Rendicion</b></td>
                          <td align="right" width="100px">
                              <asp:Label ID="totalPendienteLBL" runat="server"></asp:Label>
                          </td>
                          <td align="right" width="100px">
                              <asp:Label ID="totalPendienteDOL" runat="server"></asp:Label>
                          </td>
                      </tr>
                  </table>
                   </asp:Panel>
              </td>
          </tr>
      </table>


    
             
          
 </ContentTemplate>
                  </asp:UpdatePanel>  
     



 
   
     <input id="idObra" type="hidden" runat="server" />
      <asp:UpdatePanel ID="estructuraUpdate" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
     <table>
     <tr>
     <td>
         </td>
     <td>
 
         <strong>DESCRIPCION:</strong>
         </TD>
         <td>
         <asp:DropDownList ID="cajaDDL" runat="server" Width="250px" AutoPostBack="True" 
                 onselectedindexchanged="cajaDDL_SelectedIndexChanged">
         </asp:DropDownList>
 
     </td>
           <td>
            <asp:Button ID="nuevoRendicionBtn" runat="server" CssClass="ms-crm-List-Header"  Enabled="false"
                Text="Generar Nueva Rendicion" onclick="loadRendicion"  />

                <asp:LinkButton ID="depositoLinkButton" runat="server" />
                <asp:modalpopupextender ID="depositoModalpopupextender" runat="server" 
              BackgroundCssClass="modalBackground" 
              CancelControlID="CancelButton" dropshadow="True" 
              RepositionMode="None"
              X="0" Y="0"
              DynamicServicePath="" Enabled="True" popupcontrolid="addRecursoParentPanel" 
              popupdraghandlecontrolid="AddRecursoPanel" targetcontrolid="depositoLinkButton"/>
    </td>
   </tr>
     </tr>
         <tr>
             <td colspan="4"  style="background-color:#FFCCFF">
                 * Solo puede generar nueva Rendicion si el Anterior fue Aprobado.</td>
             
         </tr>
     </table>
       
       <hr />
                <asp:GridView ID="estructuraGridView" 
                SkinID="GridView" 
                DataKeyNames="idInternal" 
                OnRowDataBound="gvestructura_RowDataBound"
              ShowHeaderWhenEmpty="true"
                Runat="server" onselectedindexchanged="estructuraGridView_SelectedIndexChanged"   
                
                    > 
                    <Columns>

                    <asp:HyperLinkField   ControlStyle-ForeColor="Blue" 
                        ItemStyle-Width="70px"
                        HeaderText="NUMERO"
                        datatextfield="numDocumento" 
                        datanavigateurlfields="idInternal,idObra"
                        DataNavigateUrlFormatString="RendicionEditForm.aspx?id={0}&idObra={1}"  />
                        <asp:HyperLinkField   ControlStyle-ForeColor="Blue" 
                        ItemStyle-Width="70px" Target="_blank"
                        HeaderText=""
                        Text="Imprimir"
                        datanavigateurlfields="idInternal,idObra"
                        DataNavigateUrlFormatString="../../Rpt/PrintForm.aspx?type=CAJACHICA&id={0}&idObra={1}"  />
                    <asp:BoundField DataField="descripcion"  HeaderStyle-Width="250px" HeaderText="DESCRIPCION"/>
                    <asp:BoundField DataField="estadoStr" HeaderStyle-Width="100px" HeaderText="ESTADO"/>
                    <asp:BoundField DataField="totalSaldoAnteriorStr"  HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Right" HeaderText="SALDO ANTERIOR"/>
                    <asp:BoundField DataField="totalAsignadoStr"  HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Right" HeaderText="TOTAL DEPOSITO"/>
                    <asp:BoundField DataField="totalGastadoStr" HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Right" HeaderText="TOTAL RENDICION"/>
                    <asp:BoundField DataField="totalSaldoStr" HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" HeaderText="SALDO"/>
                      <asp:TemplateField HeaderText="" ItemStyle-Width="50px">
                            <ItemTemplate>
                      <asp:ImageButton  ID="lnkRemove" runat="server" BorderColor="Control" 
                                    CommandArgument='<%# Eval("idInternal")%>' OnClick="Deleteitem" 
                                    OnClientClick="return confirm('Usted quiere eliminar: depositos y la rendicion de documentos?')" 
                                    ImageUrl="~/Images/delete.gif" />
                                    </ItemTemplate>
                                    </asp:TemplateField>
                    
                    </Columns>
                   
           
    
    </asp:GridView> 
    
         </ContentTemplate>
                           </asp:UpdatePanel>
       </asp:Panel>





       
  
  <asp:Panel ID="addRecursoParentPanel" runat="server" Height="300px" >
  <asp:Panel ID="AddRecursoPanel"   runat="server"  Width="700px"
    Style="background-color:#DDDDDD;border:solid 1px Gray;color:Black">
 
 <asp:UpdatePanel ID="SeleccionUpdatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
            <asp:Panel ID="Panel7" runat="server" Height="270px"  class="ms-crm-Dialog-Footer ms-crm-Dialog-Footer-Right">

               <uc2:RendicionAddPanel ID="RendicionAddPanel1" runat="server" />  
  </asp:Panel>

</ContentTemplate>
</asp:UpdatePanel>


<asp:Panel ID="Panel19" runat="server"   >
        
<table width="100%" >
 <tr  >
               
                <td class=" ms-crm-Dialog-Footer-Right">
               <%--  --%>
                     <asp:Button ID="OkButton"  runat="server"  Text="Guardar"  CssClass="ms-crm-List-Header"
                      OnClientClick="return confirm('Usted quiere Agregar los Rendicion?')"
                       OnClick="nuevoRendicionBtn_Click"
                        />
                    <asp:Button ID="CancelButton"  runat="server" Text="Cancelar" CssClass="ms-crm-List-Header"
                    
                       
                       />&nbsp;
                   
                </td>
   </tr>


   
</table>
        </asp:Panel> 



        </asp:Panel>
</asp:Panel>



      
    </form>
</body>
</html>
